package com.edbergogroup.springexamples.core;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

public class FixedValueSimpleServiceImplWithAnnonations implements SimpleService {

	private Integer calcValue;
	
	public void foo() {
		System.out.println("Printing out foo from actual implementation");

	}

	@PostConstruct
	public void postconstruct(){
		System.out.println("PostConstruct Setting calValue to 1");
		calcValue=1;
	}
	
	@PreDestroy
	public void preDestroy(){
		System.out.println("PreDestroy. Godbye!");
	}
	
	public int bar() {
		
		return calcValue*10;
	}

	public FixedValueSimpleServiceImplWithAnnonations(int calcValue) {
		this.calcValue = calcValue;
	}

	

	

}
